package main

import (
	"oberserverDemo/src/Publisher"
	"oberserverDemo/src/Subscribe"
	"fmt"
)

func main() {
	publisher := Publisher.NewPublisher()
	subscriber := new(Subscribe.Subscribe)

	publisher.AddSubscriber(Publisher.HandlerFunc(subscriber.Dosome))
	fmt.Println("1")
	publisher.AddSubscriber(Publisher.HandlerFunc(subscriber.Eatsome))
	fmt.Println("2")
	publisher.Notify(publisher.Value)
	fmt.Println("3")
	//fmt.Println("hhh")
}